
var initUserAreaInfoBean;
var getUserAreaInfoBeanFromOpenPage = function(){
	var userareainfoBean = {};
	userareainfoBean.id = jQuery('#idEditor').val();
	
	
	userareainfoBean.userId = jQuery('#userIdEditor').val();
	
	if(!userareainfoBean.userId){
		$.ligerDialog.error("请输入用户!");
		return null;
	}	userareainfoBean.areaId = jQuery('#areaIdEditor').val();
	
	if(!userareainfoBean.areaId){
		$.ligerDialog.error("请输入社区大厦!");
		return null;
	}	userareainfoBean.orderId = jQuery('#orderIdEditor').val();
	
	if(!userareainfoBean.orderId){
		$.ligerDialog.error("请输入序号!");
		return null;
	}	userareainfoBean.collectId = jQuery('#collectIdEditor').val();
	
	if(!userareainfoBean.collectId){
		$.ligerDialog.error("请输入归集人!");
		return null;
	}	userareainfoBean.collectState = jQuery('#collectStateEditor').val();
	
	userareainfoBean.state = jQuery('#stateEditor').val();
	
	userareainfoBean.floor = jQuery('#floorEditor').val();
	
	userareainfoBean.room = jQuery('#roomEditor').val();
	
	
	return userareainfoBean;
};

var initUserAreaInfoPage = function(){
	
	
	
	
	
	
	
	
	
};

var bindUserAreaInfoUpdateButtom = function(){
	jQuery('#updateEdit').unbind('click').click(function(){
		var userareainfoBean = getUserAreaInfoBeanFromOpenPage();
		if(null != userareainfoBean){
			doSaveUserAreaInfos([userareainfoBean]);
		}
	});
};
var bindUserAreaInfoResetButtom = function(){
	jQuery('#resetEdit').unbind('click').click(function(){
		if(!initUserAreaInfoBean){
			jQuery("#userIdEditor").val('');
			jQuery("#areaIdEditor").val('');
			jQuery("#orderIdEditor").val('');
			jQuery("#collectIdEditor").val('');
			jQuery("#collectStateEditor").val('');
			jQuery("#stateEditor").val('');
			jQuery("#floorEditor").val('');
			jQuery("#roomEditor").val('');
		}else{
			if(!initUserAreaInfoBean.userId){
				jQuery("#userIdEditor").val('');
			}else{
				jQuery("#userIdEditor").val(initUserAreaInfoBean.userId);
			}
			if(!initUserAreaInfoBean.areaId){
				jQuery("#areaIdEditor").val('');
			}else{
				jQuery("#areaIdEditor").val(initUserAreaInfoBean.areaId);
			}
			if(!initUserAreaInfoBean.orderId){
				jQuery("#orderIdEditor").val('');
			}else{
				jQuery("#orderIdEditor").val(initUserAreaInfoBean.orderId);
			}
			if(!initUserAreaInfoBean.collectId){
				jQuery("#collectIdEditor").val('');
			}else{
				jQuery("#collectIdEditor").val(initUserAreaInfoBean.collectId);
			}
			if(!initUserAreaInfoBean.collectState){
				jQuery("#collectStateEditor").val('');
			}else{
				jQuery("#collectStateEditor").val(initUserAreaInfoBean.collectState);
			}
			if(!initUserAreaInfoBean.state){
				jQuery("#stateEditor").val('');
			}else{
				jQuery("#stateEditor").val(initUserAreaInfoBean.state);
			}
			if(!initUserAreaInfoBean.floor){
				jQuery("#floorEditor").val('');
			}else{
				jQuery("#floorEditor").val(initUserAreaInfoBean.floor);
			}
			if(!initUserAreaInfoBean.room){
				jQuery("#roomEditor").val('');
			}else{
				jQuery("#roomEditor").val(initUserAreaInfoBean.room);
			}
		}
	});
};



jQuery(function(){
	initUserAreaInfoPage();
	bindUserAreaInfoUpdateButtom();
	bindUserAreaInfoResetButtom();
});